﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CompilerLib.Scanner
{
    public sealed class AlternationExpression : RegularExpression
    {
        public RegularExpression Expression1 { get; set; }
        public RegularExpression Expression2 { get; set; }
        public AlternationExpression(RegularExpression exp1, RegularExpression exp2)
        {
            Expression1 = exp1;
            Expression2 = exp2;
        }
        public override string ToString()
        {
            return Expression1.ToString() + "|" + Expression2.ToString();
        }

        internal override T Accept<T>(RegularExpressionConverter<T> converter)
        {
            return converter.ConvertAlternation(this);
        }
    }
}
